#ifndef WIND_FLAG_H
#define WIND_FLAG_H

#include "Entity.h"
#include "../WindowsCompatibility/Physx.h"
#include "../SurfaceRenderingData.h"
#include "../WrappedContainers/ArrayList.h"

class Flag : public Entity {
protected:
	static const int cellCountX;
	static const int cellCountY;
	static const float cellSize;
	static const float density;
	static const float thickness;
	static const float bendingStiffness;
	static const float poleHeight;

	static NxClothMesh* clothMesh;
	static NxClothMeshDesc cmDesc;

	static SurfaceRenderingData srdCloth;
	static SurfaceRenderingData srdPole;

	NxCloth *cloth;
	NxForceFieldLinearKernel* linearKernel;
	NxForceField* forceField;

	NxVec3 position;

	static NxReal *textCoords;

public:
	static ArrayList<Flag*> all;

public:
	static void Load();

	Flag(const NxVec3& pos);
	virtual ~Flag();

	void SetWind(const NxVec3& force);

	inline const NxVec3& GetPosition() { return position; }
	static inline float GetPoleHeight() { return poleHeight; }

	virtual void Draw();
};

#endif //WIND_FLAG_H
